require.config({
    baseUrl:"./modules",
    paths:{
          jq:"../libs/jquery",
          fdj:"fdj",
          getgoods:"getgoods"
    }
    
});

require(["jq","fdj","getgoods"],(_,fdj,getgoods)=>{
    //  console.log($);
//   $(".xqbzl")
fdj();
const url = "http://localhost:3000/api?type=getGoods";

const id = location.search.split("=")[1];
console.log(id); 

getgoods((res)=>{
    let i = 0;
    res.some((val,idx)=>{
        i=idx;
        return val.goodsId===id;

    })
    console.log(res);
    console.log(res[i]);
    let str = `<div class="xqwlsbz">
    <div class="fdjdt" style="position: absolute;background-color: sandybrown;width: 200px;height: 200px;left: 320px;top: 50px;z-index: 1;overflow: hidden;display: none;">
        <img src="${res[i].img}" alt="" class="fdjjj" style="width: 1040px; position: absolute;">
        </div>
    <div class="xqbzl" style="position: relative;">
        
        <div class="wlsbox" style="position: relative;">
            <div class="fdjzzc" style="pointer-events: none; width: 50px;height: 50px;background-color:rgba(100, 100, 100, 0.8);position: absolute;display: none;">

            </div>
           <img src="${res[i].img}" alt=""> 
        </div>
        
        <div class="xxxxxx iconfont" style="font-size: 10px;">&#xe627; 收藏商品 <span style="position: absolute;top: 0;right: 0;font-size: 15px;">&#xe602;</span></div>
    </div>
    <div class="xqbzr">
        <h3 style="    font-size: 18px;
        text-indent: 15px;
        font-weight: bold;
        color: #2e2e2e;">${res[i].proName}</h3>
        <h4 style="    margin-top: 6px;
        width: 456px;
        height: 76px;
        background: url(./images/images/al_03.png);background-size: cover;
        background-position: -5px -143px;
        position: relative;">
        <span style="display: block;position: absolute;left: 0;top:10px;">Q币价：${res[i].qb} Q币</span>
        <span style="display: block;position: absolute;left: 0;top:38px;">微信价：<span style="font-size: 20px;font-weight: 900;"> ￥${res[i].wx} </span></span>
        </h4>
        <h5 style="line-height: 45px;">期限：永久</h5>
        <h6><span style="display: block; width: 142px;height: 42px;margin: 10px 9px 0px 15px;background-color: seagreen;text-align: center;line-height: 42px;font-size: 15px;float: left;color: seashell;">加入购物车</span><span style="display: block; width: 142px;height: 42px;margin: 10px 9px 0px 15px;background-color: rosybrown;text-align: center;line-height: 42px;font-size: 15px;float: left;color: seashell;">购买</span> </h6>
    </div>
</div>





  <div class="bzx">
      <span style="display: block;float: left;">商品详情</span>
      <h1></h1>
     
      <span class="iconfont" style="display: block;float: left;">手机购买 &#xe604;</span>
      <div style="padding: 60px 72px 0px 72px;">${res[i].proName}</div>
  </div>`
    $(".xqwls").html(str)

    


}
   
    
)

 
  



})



